<template>
  <div class="home">
    <el-container>
      <el-aside class="aside">
        <el-header class="headleft">
          <div class="logo">TIMO后台</div>
        </el-header>
        <div class="avatar">
          <div class="avatarimg">
            <img src="../assets/logo.png" alt="" />
          </div>
          <div>
            <p class="title">超级管理员</p>
            <p class="state">
              <i class="el-icon-success"></i>
              <span>在线</span>
            </p>
          </div>
        </div>
        <!-- 一级菜单 -->
        <el-menu
          class="menu"
          background-color="#222d32"
          text-color="#fff"
          active-text-color="#ffd04b"
          :router="true"
        >
          <el-submenu
            index="/home"
            class="item"
            style="background: #007d71; color: #fff"
          >
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span>主页</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/home/1-1">主页</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 二级菜单 -->
          <!-- 数据管理 -->
          <el-submenu index="2" class="item">
            <template slot="title">
              <i class="el-icon-notebook-2"></i>
              <span>系统管理</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/home/2-1">用户管理</el-menu-item>
              <el-menu-item index="2-2">角色管理</el-menu-item>
              <el-menu-item index="2-3">菜单管理</el-menu-item>
              <el-menu-item index="2-4">部门管理</el-menu-item>
              <el-menu-item index="2-5">字典管理</el-menu-item>
              <el-menu-item index="2-6">行为日志</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <!-- 添加数据 -->
          <el-submenu index="3" class="item">
            <template slot="title">
              <i class="el-icon-circle-plus-outline"></i>
              <span>开发中心</span>
            </template>
            <el-menu-item-group>
              <el-menu-item index="/home/3-1">代码生成</el-menu-item>
              <el-menu-item index="/home/3-2">表单构建</el-menu-item>
              <el-menu-item index="3-3">数据接口</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header class="headright">
          <div class="left">
            <i class="el-icon-s-fold"></i>
          </div>
          <div class="right">
            <i class="el-icon-bell"></i>
            <i class="el-icon-full-screen"></i>
            <!-- 下拉菜单 -->
            <el-dropdown>
              <span class="el-dropdown-link">
                下拉菜单<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item
                  ><i class="el-icon-user"></i>个人信息</el-dropdown-item
                >
                <el-dropdown-item
                  ><i class="el-icon-lock"></i>修改密码</el-dropdown-item
                >
                <el-dropdown-item
                  ><router-link to="/" tag="span"
                    ><i class="el-icon-switch-button"></i>退出登录</router-link
                  ></el-dropdown-item
                >
              </el-dropdown-menu>
            </el-dropdown>
          </div>
        </el-header>
        <!-- 面包屑 -->
        <div>
          <el-breadcrumb separator="/" class="head-nav">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item
              :to="{ path: '/' }"
              v-for="(item, index) in this.$route.meta"
              :key="index"
              >{{ item }}</el-breadcrumb-item
            >
          </el-breadcrumb>
        </div>
        <!-- 内容 -->
        <el-main class="main">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "HomeView",
  data() {
    return {};
  },
  methods: {},
  components: {},
};
</script>
<style scoped>
.main {
  background: #eee;
  height: 400px;
}
.aside {
  width: 220px !important;
  height: 100vh;
  overflow: hidden;
}
.headleft {
  width: 220px;
  height: 50px !important;
  padding: 0;
  text-align: center;
}
.logo {
  background: #007d71;
  width: 220px;
  height: 100%;
  color: #fff;
  line-height: 50px;
  font-size: 16px;
}
.avatar {
  width: 220px;
  height: 88px;
  /* margin: 10px 0; */
  padding: 20px;
  background: #222d32 !important;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  color: #fff;
}
.avatar .avatarimg {
  width: 48px;
  height: 48px;
  margin-right: 15px;
  border-radius: 24px;
  overflow: hidden;
}
.avatar .avatarimg img {
  width: 100%;
  height: 100%;
}
.avatar .title {
  font-size: 16px;
}
.avatar .state {
  font-size: 14px;
}
.avatar .state i {
  color: #007d71;
  margin-right: 10px;
}
.menu {
  width: 220px;
  height: 100%;
  background: #222d32;
}
.headright {
  height: 50px !important;
  background: #007d71;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  padding: 0 20px;
  box-sizing: border-box;
}
.headright i {
  font-size: 16px;
}
.headright .right {
  width: 150px;
  display: flex;
  justify-content: space-between;
}
.el-dropdown-link {
  cursor: pointer;
  color: #fff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.head-nav {
  height: 40px;
  line-height: 40px;
  color: #007d71;
}
.main {
  padding: 0;
}
</style>